import { Component, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { UserService } from '@nx-chat/common/service';
import { increment, decrement, reset } from '@nx-chat/store';
import { Observable } from 'rxjs';

@Component({
  selector: 'explore-index',
  templateUrl: './explore-index.component.html',
  styleUrls: ['./explore-index.component.scss']
})
export class ExploreIndexComponent implements OnInit {

  count$: Observable<number>

  constructor(
    private userService: UserService,
    private store: Store<{ count: number }>
  ) {
    this.count$ = store.select('count');
  }

  increment() {
    this.store.dispatch(increment());
  }

  decrement() {
    this.store.dispatch(decrement());
  }

  reset() {
    this.store.dispatch(reset());
  }

  ngOnInit() {

  }

}
